#include <stdio.h>

#define MAX_N	20
#define MAX_K	20
#define MAX_F	20000
#define INF 	10000

int a[MAX_K]; 
int n, k; 

int f[MAX_F]; 

int max_c; 
int ar[MAX_K]; 

int min(int a, int b)
{
	return a<b?a:b;
}

void check_result(void)
{
	int i, c=1, p; 
	f[0] = 0; 
	while (1) {
		f[c] = INF; 
		for (i=0; i<=k; i++) {
			p = c-a[i]; 
			if (p<0) 
				continue; 
			f[c] = min(f[c], f[p]+1); 
		}
		if (f[c]>n) 
			break; 
		c++;
	}
	/*
	for (i=0; i<=k; i++) {
		printf("%d ", a[i]); 
	}
	printf("f[%d]=%d\n", c, f[c]); 
	*/
	if (c-1>max_c) {
		max_c = c-1; 
		for (i=0; i<=k; i++) {
			ar[i] = a[i]; 
		}
	}
}

void dfs(int s)
{	
	int i; 

	for (i=a[s-1]+1; i<=n*a[s-1]+1; i++) {
		a[s] = i; 
		if (s==k) {
			check_result(); 
		} else {
			dfs(s+1); 
		}
	}
}

int main()
{
	int i; 
	scanf("%d %d", &n, &k); 
	a[1] = 1; 
	dfs(2);
	for (i=1; i<=k; i++) 
		printf("%d ", ar[i]); 
	printf("\n"); 
	printf("MAX=%d\n", max_c); 
	return 0; 
}


